package com.my.dao.impl;

import java.util.List;

import com.my.bean.Pic;
import com.my.dao.IBaseDAO;
import com.my.dao.PicDAO;

public class PicDAOImpl implements PicDAO {
	private IBaseDAO<Pic> basedao;

	public void setBasedao(IBaseDAO<Pic> basedao) {
		this.basedao = basedao;
	}

	public boolean add(Pic pic) throws Exception {
		if (pic == null) {
			return false;
		}
		return basedao.add(pic);
	}

	@Override
	public List<Pic> getAllPic() throws Exception {
		String hql = "from Pic";
		return basedao.getList(hql);
	}
}
